package day1601;

import java.net.SocketTimeoutException;
import java.util.HashSet;
import java.util.Random;

public class hashsiet {
    public static void main(String[] args) {
        HashSet<zdyl> a = new HashSet<>();
        zdyl b = new zdyl("张三",12);//b和c拥有不同的哈希值，如果希望哈希值相同，需要修改哈希值
        zdyl c = new zdyl("张三",12);
        zdyl d = new zdyl("张2",12);
        zdyl e = new zdyl("张2",12);
        a.add(b);
        a.add(c);
        a.add(d);
        a.add(e);
        System.out.println(a);
        System.out.println(b.hashCode());
        System.out.println(c.hashCode());
        System.out.println(d.hashCode());
        System.out.println(e.hashCode());
    }
}
